<template>
  <div>
    <!-- 声明式导航  vue-router@3 -->
    <div>
      <router-link :to="`/home?id=${id}`">首页</router-link>
      <router-link :to="`/category/${id}`">分类</router-link>
      <!-- <router-link :to="{path:'/car',query:{id:id}}">购物车</router-link> -->
      <router-link :to="{path:'/car/99'}">购物车</router-link>
      <router-link :to="{name:'mine',params:{id:id}}">我的</router-link>
    </div>
    <!-- <ul>
      <li @click="$router.push('/home')">首页</li>
    </ul>-->
    <!-- 一级路由的坑 -->
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  data() {
    return {
      id: 100
    };
  }
};
</script>
<style scoped>
</style>